// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import './style/reset.css'
import store from './store/'
import './config/rem.js'
import Vant from 'vant';
import 'vant/lib/index.css';
import MintUI from 'mint-ui'
import 'mint-ui/lib/style.css'
import './assets/iconfont/iconfont.css'
import Mui from 'vue-awesome-mui';
import axios from './api/http.js'
import utils from './api/wxlogin.js';
import moment from 'moment';
import VueClipboard from 'vue-clipboard2';
// import base from './api/base64'
import base64 from './api/base64.js'
import MyPlugin from './api/MyPlugin.js'
Vue.use(MyPlugin);
Vue.use(base64);
Vue.use(VueClipboard)
    // import base64 from './api/base64.js'
Vue.prototype.$axios = axios;
Vue.prototype.$utils = utils;
axios.defaults.baseURL = window.domain;
console.log(window.domain);

Vue.use(MintUI);
Vue.use(Mui);
Vue.use(Vant);
Vue.filter('dateFmt', (input, formatString = "YYYY-MM-DD") => {
        //es5函数参数设置默认值
        //const lastFormatString = formatString || 


        // moment(input) 把时间字符串转成时间对象
        // format(formatString) 把时间对象，按照指定格式，格式化成符合条件的字符串
        return moment(input).format(formatString)
    })
    // Vue.use(base64);
Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
    el: '#app',
    router,
    store,
    components: { App },
    template: '<App/>'
})
router.beforeEach((to, from, next) => {
    // chrome
    document.body.scrollTop = 0
        // firefox
    document.documentElement.scrollTop = 0
        // safari
    window.pageYOffset = 0
    next()
})